//
// Created by Administrator on 2023/7/29.
//

#include <iostream>

using namespace std;

class Solution {
public:
    int countDigits(int num) {
        int count = 0;
        int x = num;
        while (x) {
            int n = x % 10;
            if (num % n == 0) count++;
            x /= 10;
        }
        return count;
    }
};

int main() {
    Solution s;
    cout << s.countDigits(121) << endl;
}